package l1j.server.server.templates;

import l1j.server.server.datatables.NpcTable;
import l1j.server.server.utils.IntRange;

public class L1PetType {
	public static int getMessageNumber(int level) {
		if (50 <= level) {
			return 5;
		}
		if (48 <= level) {
			return 4;
		}
		if (36 <= level) {
			return 3;
		}
		if (24 <= level) {
			return 2;
		}
		if (12 <= level) {
			return 1;
		}
		return 0;
	}

	private final int _baseNpcId;

	private final L1Npc _baseNpcTemplate;

	private final String _name;

	private final int _itemIdForTaming;

	private final IntRange _hpUpRange;

	private final IntRange _mpUpRange;

	private final int _npcIdForEvolving;

	private final int _msgIds[];

	private final int _defyMsgId;

	private final int _evolvItemId;

	private final boolean _canUseEquipment;

	public L1PetType(int baseNpcId, String name, int itemIdForTaming,
			IntRange hpUpRange, IntRange mpUpRange, int evolvItemId,
			int npcIdForEvolving, int msgIds[], int defyMsgId,
			boolean canUseEquipment) {
		this._baseNpcId = baseNpcId;
		this._baseNpcTemplate = NpcTable.getInstance().getTemplate(baseNpcId);
		this._name = name;
		this._itemIdForTaming = itemIdForTaming;
		this._hpUpRange = hpUpRange;
		this._mpUpRange = mpUpRange;
		this._evolvItemId = evolvItemId;
		this._npcIdForEvolving = npcIdForEvolving;
		this._msgIds = msgIds;
		this._defyMsgId = defyMsgId;
		this._canUseEquipment = canUseEquipment;

	}

	public boolean canEvolve() {
		return this._npcIdForEvolving != 0;
	}

	public boolean canTame() {
		return this._itemIdForTaming != 0;
	}

	// 可使用寵物裝備
	public boolean canUseEquipment() {
		return this._canUseEquipment;
	}

	public int getBaseNpcId() {
		return this._baseNpcId;
	}

	public L1Npc getBaseNpcTemplate() {
		return this._baseNpcTemplate;
	}

	public int getDefyMessageId() {
		return this._defyMsgId;
	}

	// 進化道具
	public int getEvolvItemId() {
		return this._evolvItemId;
	}

	public IntRange getHpUpRange() {
		return this._hpUpRange;
	}

	public int getItemIdForTaming() {
		return this._itemIdForTaming;
	}

	public int getMessageId(int num) {
		if (num == 0) {
			return 0;
		}
		return this._msgIds[num - 1];
	}

	public IntRange getMpUpRange() {
		return this._mpUpRange;
	}

	public String getName() {
		return this._name;
	}

	public int getNpcIdForEvolving() {
		return this._npcIdForEvolving;
	}

}
